package com.example.dormitorymanagement.repository;

import com.example.dormitorymanagement.model.Building;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface BuildingRepository extends JpaRepository<Building, Integer> {

    // 根据名称查询宿舍楼
    List<Building> findByNameContainingIgnoreCase(String name);

    // 检查宿舍楼名称是否已存在
    boolean existsByName(String name);
}